package grpc.impl;

import grpc.proto.MyRequest;
import grpc.proto.MyResponse;
import grpc.proto.StudentServiceGrpc;
import io.grpc.stub.StreamObserver;

import java.util.Random;

/**
 * @author RJA
 * @version V1.0
 * @Title: grpc.impl.StudentServiceImpl
 * @Description:
 * @date 2019/8/23 16:41
 */
public class StudentServiceImpl extends StudentServiceGrpc.StudentServiceImplBase{

    @Override
    public void getRealnameByUsername(MyRequest request, StreamObserver<MyResponse> responseObserver) {
        System.out.println("get client message:" + request.getUsername());
        responseObserver.onNext(MyResponse.newBuilder().setRealname("张三").build());
        responseObserver.onCompleted();
    }
}
